package com.bit.rpc.register;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;

import java.io.IOException;

public class RegisterServer {

    public Watcher watcher = new Watcher() {
        public void process(WatchedEvent watchedEvent) {
            System.out.println(watchedEvent.toString());
        }
    };

    private ZooKeeper zk;

    private void getInstance() throws IOException {
        zk = new ZooKeeper("127.0.0.1:2181",30000,watcher);
    }

    private void closeZookeeper() throws InterruptedException {
        zk.close();
    }

}
